package ObjM;
use Moo;
use MooX::Cmd;
use MooX::Options with_config_from_file=>1,prefer_commandline=>1;
use Types::Standard qw(Str);
use Modern::Perl;

option 'x2' => (
  is => 'lazy',
  isa => Str,
  format => 's',
  builder => 1,
  predicate => 1,
);

sub _build_x2 { 50 };

=pod
sub BUILD {
   print "This is objm build start\n";
  my $self = shift;
  if ($self->has_x2) {
    print "x2 attribute set\n";
  } else {
    print "x2 attribute not set\n";
    $self->x2(50);
  }
  print "Tis is objm build done\n";
}
=cut
has mother => (
  is => 'ro',
  default => sub{ 'mother' },
);

1;
